package view;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import model.KundenModel;
import controller.KundenController;

public class Main {

	public Main() {
		KundenModel kundenModel = new KundenModel();
		KundenController controller = new KundenController(kundenModel);
		final JFrame frame = new JFrame("Beispiel MVC");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		JPanel infoview = new InfoView(controller);
		JPanel listView = new ListView(controller);
		JPanel lastView = new LastView(controller);

		frame.add(infoview, BorderLayout.SOUTH);
		frame.add(listView, BorderLayout.CENTER);
		frame.add(lastView, BorderLayout.NORTH);

		SwingUtilities.invokeLater(new Runnable() {

			@Override
			public void run() {
				frame.pack();
				frame.setVisible(true);
			}
		});
	}

	public static void main(String[] args) {
		new Main();
	}
}
